﻿using System;
using System.Linq;
using AutoR.Services;
using LiteDB;

namespace AutoR.Models
{
	// Token: 0x02000201 RID: 513
	public class StatBuild
	{
		// Token: 0x17000370 RID: 880
		// (get) Token: 0x06000B88 RID: 2952 RVA: 0x0006D4C9 File Offset: 0x0006B6C9
		// (set) Token: 0x06000B89 RID: 2953 RVA: 0x0006D4D1 File Offset: 0x0006B6D1
		public ObjectId Id { get; set; } = ObjectId.NewObjectId();

		// Token: 0x17000371 RID: 881
		// (get) Token: 0x06000B8A RID: 2954 RVA: 0x0006D4DA File Offset: 0x0006B6DA
		// (set) Token: 0x06000B8B RID: 2955 RVA: 0x0006D4E2 File Offset: 0x0006B6E2
		public int ShipCid { get; set; }

		// Token: 0x17000372 RID: 882
		// (get) Token: 0x06000B8C RID: 2956 RVA: 0x0006D4EB File Offset: 0x0006B6EB
		// (set) Token: 0x06000B8D RID: 2957 RVA: 0x0006D4F3 File Offset: 0x0006B6F3
		public int Count { get; set; }

		// Token: 0x17000373 RID: 883
		// (get) Token: 0x06000B8E RID: 2958 RVA: 0x0006D4FC File Offset: 0x0006B6FC
		[BsonIgnore]
		public string Name
		{
			get
			{
				ShipConfig shipConfig = Runtime.Configs.shipCard.SingleOrDefault((ShipConfig s) => s.cid == this.ShipCid);
				if (shipConfig == null)
				{
					return null;
				}
				return shipConfig.title;
			}
		}
	}
}
